package com.wan.lession.aop;

import org.aopalliance.aop.Advice;
import org.springframework.aop.MethodBeforeAdvice;

import java.lang.reflect.Method;
import java.util.Arrays;

public class MyBeforeAdvice implements MethodBeforeAdvice, Advice {
    @Override
    public void before(Method method, Object[] args, Object target) throws Throwable {
        System.out.println("这个是前置增强");
        System.out.println("开启事务");
        System.out.println("被增强方法的名称"+method.getName());
        System.out.println("被增强方法的参数列表"+ Arrays.toString(args));
    }
}
